package com.xing.beanmap;

import com.xing.bean.api.Bean;
import lombok.Data;

import java.util.Map;

public class BeanMapTest {

    static class Dto {
        private int id;
        private String userName;
        private String userPhone;
        private String userEmail;

        private Dto() {

        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public String getUserPhone() {
            return userPhone;
        }

        public void setUserPhone(String userPhone) {
            this.userPhone = userPhone;
        }

        public String getUserEmail() {
            return userEmail;
        }

        public void setUserEmail(String userEmail) {
            this.userEmail = userEmail;
        }
    }

    public static void main(String[] args) {
        Dto dto = new Dto();
        dto.setId(1);
        dto.setUserEmail("2");
        dto.setUserName("3");
        dto.setUserPhone("11111");

        Map<String, Object> map = BeaMapUtil.beanToMap(dto);
        System.out.println(map);
    }
}
